﻿using SMARTMobile.WinPhone.Models;

namespace SMARTMobile.Models.UI
{
    public class TownModel : BaseModel<TownModel>
    {
        private string _appStatus;
        private string _provinceCode;
        private string _code;
        private string _name;

        public TownModel()
        {
            this.AppStatus = string.Empty;
            this.ProvinceCode = string.Empty;
            this.Code = "0";
            this.Name = "Chon Quan/Huyen";
        }

        public TownModel(SqlTown town)
        {
            this.AppStatus = town.AppStatus;
            this.ProvinceCode = town.ProvinceCode;
            this.Code = town.TownCode;
            this.Name = town.TownName;
        }

        public string AppStatus
        {
            get { return this._appStatus; }
            set
            {
                this._appStatus = value;
                base.RaisePropertyChanged(me => me.AppStatus);
            }
        }

        public string ProvinceCode
        {
            get { return this._provinceCode; }
            set
            {
                this._provinceCode = value;
                base.RaisePropertyChanged(me => me.ProvinceCode);
            }
        }

        public string Code
        {
            get { return this._code; }
            set
            {
                this._code = value;
                base.RaisePropertyChanged(me => me.Code);
            }
        }

        public string Name
        {
            get { return this._name; }
            set
            {
                this._name = value;
                base.RaisePropertyChanged(me => me.Name);
            }
        }

        public override string ToString()
        {
            return this.Name;
        }
    }
}
